package com.example.webdemo.controller;

import com.example.webdemo.entity.UserMybatis;
import com.example.webdemo.mapper.UserMybatisMapper;
import com.example.webdemo.mapper.UserMybatisMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MybatisControl {
    @Autowired
    UserMybatisMapper userMapper;
    @RequestMapping("insert")
    public String insertUser(){
        UserMybatis user = new UserMybatis();
        user.setUsername("test");
        user.setPassword("123");
        userMapper.insertSelective(user);
        return "fail";
    }
}
